<!DOCTYPE html>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="renderer" content="webkit" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>{:get_system_config('web','admin_title')}</title>	
	<link rel="stylesheet" href="{__CSS__}/student.css" />
	<link rel="stylesheet" href="{__GOUGU__}/layui/css/layui.css" />
</head>

<body>
	<div id="container">
		<div class="login">
			{//内框开始}
			<div class="wrap">

					<div class="login-logo"><a href="/"><img src="{__IMG__}/student_course_logo.png"></a></div>

						
					<form id="selectCourse" class="layui-form">
						<div class="layui-form-item">
							<label class="layui-form-label">班 级：</label>
							<div class="layui-input-inline">
							<input type="text" name="bj_name" placeholder="班级"  class="login-input layui-disabled" value="{$student.bj_name}">
						    </div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">姓 名：</label>
							<div class="layui-input-inline">
							<input type="text" name="name" placeholder="姓名"  class="login-input layui-disabled" value="{$student.name}">
						    </div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">手 机：</label>
							<div class="layui-input-inline">
							<input type="text" name="mobile" placeholder="手机"  class="login-input" value="{$student.mobile}">
						    </div>
						</div>
						
						<div class="layui-form-item">
							<label class="layui-form-label">第一志愿</label>
                            <div class="layui-input-inline">
                            <select name="zy1" id="zy1" class="login-input" lay-filter="zy1Filter">
							<option value="{$student.zy1}">{$student.zy1}</option>
							{volist name="course_list" id="v"}
							<option value="{$v.cname}">{$v.cname}</option>
							{/volist}
							
							</select>
						    </div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">第二志愿</label>
                            <div class="layui-input-inline">
                            <select name="zy2" id="zy2" class="login-input" lay-filter="zy2Filter">
							<option value="{$student.zy2}">{$student.zy2}</option>
							{volist name="course_list" id="v"}
							<option value="{$v.cname}">{$v.cname}</option>
							{/volist}
							</select>
							
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-inline-block">
							<input type="hidden" name="id" value={$student.id} >
							<button id="courseSubmit" type="button" class="login-btn">提交</button>
						   </div>
						  </div>					
					</form>
					<div class="footer-operation">
				        <button id="courseinfo" type="button" >已报名，查看报名结果</button><br/>
				        	<a href="javascript:;" data-node="logout" >退出系统，重新登录</a>
					</div>

								
                </div>
			</div>
	
		<div class="foot">
			{:get_system_config('web','copyright')} <a id="beian" href="//www.beian.miit.gov.cn" target="_blank"
				rel="nofollow" style="margin-left: 12px;color:#458BF3">{:get_system_config('web','icp')}</a>，Powered by GouguCMS
		</div>
	</div>
	<script language="javascript" src="{__JS__}/jquery.min.js"></script>
	<script language="javascript" src="{__JS__}/layer/layer.js"></script>
	<script src="{__GOUGU__}/layui/layui.js"></script>
	<script type="text/javascript">
		$('#courseinfo').on('click',function(){
			window.location.href="{:url('/home/student/courseinfo')}";
		});
		$('#courseSubmit').on('click', function () {
			$.ajax({
				url: "/home/student/course_submit",
				data: $('#selectCourse').serialize(),
				type: 'post',
				async: false,
				success: function (res) {
					//console.log(res);
					layer.msg(res.msg);
					if (res.code === 0) {
						setTimeout(function () {
							window.location.href="{:url('/home/student/courseinfo')}";
						}, 1500);
					} else {
						window.location.href="{:url('/home/student/index')}";
					}
				}
			})
		});
		$('[data-node="logout"]').on("click", function () {
			layer.confirm('确认注销登录吗?', { icon: 7, title: '警告' }, function (index) {
				$.ajax({
					url: '/home/student/login_out',
					success: function (res) {
						layer.msg(res.msg);
						if (res.code == 0) {
							setTimeout(function () {								
								location.href = "/home/student/index"
							}, 1000)
						}
					}
				})
			})
		})
	</script>
</body>

</html>